﻿// 1.3.1.2.2. Tribonacci Triangle -> http://bgcoder.com/Contest/Practice/79

using System;

class TribonacciTriangle
{
    static void Main()
    {
        long first = long.Parse(Console.ReadLine());
        long second = long.Parse(Console.ReadLine());
        long third = long.Parse(Console.ReadLine());
        byte l = byte.Parse(Console.ReadLine());
        long elementsCount = 0L;

        for (int i = 1; i <= l; i++)    // calculating the amount of members for the triangle
        {
            elementsCount += i;
        }

        long[] tribNums = new long[elementsCount];
        tribNums[0] = first;
        tribNums[1] = second;
        tribNums[2] = third;
        for (int i = 3; i < tribNums.Length; i++)   // filling all members in an array
        {
            tribNums[i] = tribNums[i - 1] + tribNums[i - 2] + tribNums[i - 3];
        }

        long newLine = 1L;
        int numberCounterOnLine = 1;
        for (int i = 0; i < tribNums.Length; i++)   // printing the triangle
        {
            if (numberCounterOnLine == newLine)
            {
                Console.WriteLine(tribNums[i]);
                newLine++;
                numberCounterOnLine = 1;    // only after a new line to reset the counter for members on a line
            }
            else
            {
                Console.Write(tribNums[i] + " ");
                numberCounterOnLine++;
            }
        }
    }
}